package com.ruoyi.pcwl.domain.struct;

import org.mapstruct.*;
import org.mapstruct.factory.Mappers;
import com.ruoyi.pcwl.domain.ArticleChannel;
import com.ruoyi.pcwl.domain.query.ArticleChannelQuery;

/**
 * 使用mapstruct的步骤:
 *  1.引入依赖
 *  2.新建一个抽象类或者接口并标注@Mapper
 *  3.写一个转换方法，方法名字是任意的，没有要求
 *  4.获取对象INSTANCE并使用
 */
@Mapper(componentModel = "spring")
public abstract class ArticleChannelStruct {

		public static ArticleChannelStruct INSTANCE = Mappers.getMapper(ArticleChannelStruct.class);

		/**
		 * ArticleChannel-->ArticleChannelQuery
		 */
//    @Mappings(
//            value = {
//                    @Mapping(source = "totalPrice",target = "totalPrice",numberFormat = "#.00"),
//                    @Mapping(source = "publishDate",target = "publishDate",dateFormat = "yyyy-MM-dd HH:mm:ss"),
//                    @Mapping(target = "color",ignore = true),
//                    @Mapping(source = "brand",target = "brandName"),
//                    @Mapping(source = "driverDTO",target = "driverVO")
//            }
//    )
		public abstract ArticleChannelQuery ArticleChannel2ArticleChannelQuery(ArticleChannel articleChannel);
		/**
		 * ArticleChannelQuery-->ArticleChannel
		 */
		public abstract ArticleChannel ArticleChannelQuery2ArticleChannel(ArticleChannelQuery articleChannelQuery);
}